package org.sny7.openOfflineList.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.SwingUtilities;

import org.jvnet.substance.SubstanceLookAndFeel;
import org.sny7.openOfflineList.gui.SkinMenuItem;
import org.sny7.openOfflineList.util.ConfigureManager;

public class SkinMenuItemClick implements ActionListener {

	public void actionPerformed(ActionEvent e) {
		final SkinMenuItem skinMenuItem = (SkinMenuItem) e.getSource();

		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					SubstanceLookAndFeel.setSkin(skinMenuItem.getSkinClass());
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});

		ConfigureManager.setConfigure("skin", skinMenuItem.getSkinClass());
	}

}
